<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8">
<link rel='stylesheet' type='text/css' href='style.css'>
<link rel='stylesheet' type="text/css" href="d3.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://d3js.org/d3.v2.js"></script>
<!--<script src="graphit.js" type='text/javascript'></script>-->
<script src="graphM2M.js" type='text/javascript'></script>

<script type='text/javascript' src='d3_chart_2.js'></script>
<title>GraphChi Visualization Toolkit</title>
</head>

<body>
<!--<div id='wrapper' width="1024">-->
<p align="left">
<table border="0" width="1000">
 <tr>
 <td>
 <!--div id='right'>-->
  <table border="0" width="500"> 
   <tr>
   <td>
   <div class='container no-padding'>
   <img id='logo' src='logo.gif' alt='GraphLab' />
   <center>
   <h1>	GraphChi Visualization Toolkit</h1>
   <h2>Written By Danny Bickson, CMU</h2>
   <h2>Send any bug reports to danny.bickson@gmail.com</h2>
   </center>
   </div>
   </td>
   </tr>
   <tr>
   <td>
   <div class='container no-padding' align="left">
    <h2>Graph</h2>
    Graph file: <select id="order"></select>
    <table id='graph_table' width="500" border="0"></table>
   <!--</div>-->
   </td>
   </tr>
   <tr>
   <td>
   <div class='container no-padding' align="left">
   <h2>Settings</h2>
   <p>
   <table id='settings_table' width="500" border="0"> </table>
   </p>
   </div>
   </td>
   </tr>         
   </table>	
 </td>
 <td>
 <div id='large_graph'></div>
 </td>
</tr>
</table>
<!--</div>-->
</p>

<script type='text/javascript'>


check_iterations();

function check_iterations() {

	$.get('settingA', function(response){
			var settings = parse_settings(response);
			$('#settings_table').empty();
			$('#data_properties_table').empty();
			for (var ind=0; ind < settings.length-1; ind = ind+2) {
			if (ind < 17) {
			$("#settings_table").append("<tr><td>" + settings[ind] + "</td><td>" + settings[ind+1] + "</td></tr>");
			} else {
			$("#data_properties_table").append("<tr><td>" + settings[ind] + "</td><td>" + settings[ind+1] + "</td></tr>");
			}
			}
			});




	//setTimeout("check_iterations()", 500);
}

function parse_settings(text) {
	var text_arr = text.split(/[\[\]]/);
	var settings_arr = [];
	for(var i = 0; i < text_arr.length; i++) {
		if(text_arr[i].trim().length > 0) { 
			settings_arr.push(text_arr[i]);
		}
	}
	return settings_arr;
}

</script>
</body>
</html>
